home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-wos / doc / pasm.doc < prev    next >
Text File  |  1999-01-01  |  45KB  |  2,191 lines

  1. pasm V1.2          VBCC ANSI C Compiler Reference Manual            pasm V1.2
  2.  
  3. NAME
  4.      pasm - PowerPC assembler
  5.  
  6. SYNOPSIS
  7.      pasm [-mwxRVX] [-B address] [-D symbol[=value]] [-F format]
  8.           [-I include-path] [-O opt-level] [-o filename] source-file
  9.  
  10. DESCRIPTION
  11.      pasm is a 32/64-bit PowerPC assembler and its usual task is to
  12.      assemble the output of the vbcc C compiler. It supports macros
  13.      and include files, so it could also be used for direct PowerPC
  14.      program development.
  15.  
  16.      pasm uses the same syntax as Motorola's PAS assembler or the
  17.      PPC-port of the GNU assembler.
  18.  
  19.      All PowerPC standard instructions are supported: User level-,
  20.      supervisor level-, optional-, 32-bit and 64-bit instructions.
  21.      Additionally, there is a huge set of extended mnemonics as proposed
  22.      in the "PowerPC Programming Environments" from IBM and Motorola.
  23.  
  24.      The options are as follows:
  25.  
  26.      -B address
  27.              Sets the base address for absolute output format.
  28.  
  29.      -D symbol[=value]
  30.              Defines a symbol. Its value defaults to '1'.
  31.  
  32.      -F format
  33.              Sets the output file format:
  34.              0: Absolute, raw format. Base address defaults to
  35.                 zero, but may be changed by "-B addr".
  36.              1: ELF-32bit-PowerPC object.
  37.              2: EHF object. Only used under AmigaOS with WarpOS
  38.                 extension from Haage&Partner.
  39.              3: ADOS object. The difference between ADOS and and EHF
  40.                 is, that ADOS uses HUNK_CODE instead HUNK_PPC_CODE
  41.                 and doesn't support any PPC-specific relocations and
  42.                 reference types. This makes it possible to link
  43.                 simple PowerPC programs with an old linker, like
  44.                 BLink, SLink or PhxLnk.
  45.  
  46.      -I include-path
  47.              Adds another include file path. Example:
  48.              -IWork:PPCIncludes  or  -I /usr/local/include
  49.  
  50.      -m64    Enable 64-bit instructions.
  51.  
  52.      -ms     Enable supervisor instructions.
  53.  
  54.      -mo     Enable optional instructions.
  55.  
  56.      -O opt-level
  57.              Sets optimization level. The level contains 32 flags to
  58.              enable different optimizations and features. Currently,
  59.              the following are used:
  60.              0x00010000: Automatic correction of far branches. A
  61.                          "Bcc label" with label out of range (more
  62.                          than 32764 bytes away) will be converted
  63.                          into a "B!cc $+8 / B label" combination.
  64.  
  65.      -o filename
  66.              Specifies the name of the output file. If not given, pasm
  67.              will use the name of the source text and replaces the
  68.              extension by ".o".
  69.  
  70.      -R      Don't predefine register symbols r0-r31, f0-f31, cr0-c7,
  71.              xer, eq, etc.
  72.  
  73.      -V      Prints version identification and build string. Example:
  74.              pasm V0.69 (Amiga OS/M68k)  (c)1997-98 by Frank Wille
  75.              build date: Jan  2 1998, 11:51:47
  76.  
  77.      -w      Suppress all warning messages.
  78.  
  79.      -x      Undefined symbols are automatically defined as external
  80.              symbols.
  81.  
  82.      -X      No extended mnemonics. This means you will have to write
  83.              "bc 12,2,label" instead "beq label". All predefined extened
  84.              mnemonics are listed in the section EXTENDED MNEMONICS.
  85.  
  86.  
  87. GENERAL FORMAT
  88.      Source texts in the following format will be accepted by pasm:
  89.  
  90.      [<label>] [<opcode> [<operand>[,<operand>,...]]]
  91.  
  92.      The opcode field may start at the first column, because pasm requires
  93.      all labels to be terminated by a ':'. Opcodes are directives, macros
  94.      and PowerPC instructions.
  95.  
  96.      These statements are separated by a line feed (0xa) or a ';' character.
  97.      Theoretically, you can write your whole program in a single line.
  98.      Example:
  99.  
  100.      .text;.global start;start: li r3,0;blr
  101.  
  102.      Comments are introduced by a '#':
  103.  
  104.      # This is a comment
  105.              nop     # another comment
  106.  
  107.  
  108. SNYTAX
  109.  
  110.      Supported operators in expressions:
  111.  
  112.           Unary (highest priority):
  113.           +             positive
  114.           -             negate
  115.           ~             not
  116.  
  117.           Binary (priority):
  118.           +             addition (4)
  119.           -             subtraction (4)
  120.           *             multiplication (5)
  121.           /             division (5)
  122.           %             modulo (5)
  123.           <<            shift left (3)
  124.           >>            shift right (3)
  125.           &             and (2)
  126.           |             or (0)
  127.           ^             exclusive or (1)
  128.  
  129.      Supported constants:
  130.  
  131.           1234          decimal
  132.           01234         octal
  133.           0x1234        hexadecimal
  134.           0b1010        binary
  135.           "abcd"        string
  136.  
  137.      ELF relocation suffix:
  138.  
  139.           Syntax: <expression>@<reloc type>
  140.  
  141.           @l            low half word (R_PPC_ADDR16_LO)
  142.           @h            high half word (R_PPC_ADDR16_HI)
  143.           @ha           high half word for addition (R_PPC_ADDR16_HA)
  144.           @sdax         base relative section offset (R_PPC_SDAREL16)
  145.           @sdarx        base relative section offset (R_PPC_SDAREL16)
  146.  
  147.  
  148.  
  149. DIRECTIVES
  150.       .ascii <exp1>[,<exp2>,"<string1>"...]
  151.       ----------------------------------
  152.       See ".byte".
  153.  
  154.       .asciiz "<string1>"[,"<string2>"...]
  155.       ------------------------------------
  156.       See ".string".
  157.  
  158.       .align <bit_count>
  159.       ------------------
  160.       Insert as much zero bytes as required to reach an address where
  161.       <bit_count> low order bits are zero. For example ".align 2" would
  162.       make an alignment to the next 32-bit boundary.
  163.  
  164.       .baserel <section>,<base_reg>
  165.       -----------------------------
  166.       Allow base relative access via register <base_reg> in the section
  167.       called <section>. In absolute mode, <base_reg> must be initialized
  168.       with an address pointing 32764 bytes behind the start address of
  169.       this section. In EHF, <base_reg> must be initialized with the linker
  170.       symbol _LinkerDB. By default, base relative access via r2 (rtoc)
  171.       on the section ".tocd" is set.
  172.       ** This directive is obsolete, since pasm V1.1! **
  173.       pasm can access multiple small data sections using the .sdreg
  174.       directive now. .baserel may be useful, when creating an
  175.       absolute output file, though.
  176.  
  177.       .bss <symbol>,<size>[,<alignment>]
  178.       ----------------------------------
  179.       Allocate <size> bytes of space in the .bss section and assign
  180.       the value to that location to <symbol>. If <alignment> is given,
  181.       then the space will be aligned to an address having <alignment>
  182.       low zero bits or 2, whichever is greater.
  183.       <symbol> may be made globally visible by the .globl directive.
  184.  
  185.       .byte <exp1>[,<exp2>,"<string1>"...]
  186.       ------------------------------------
  187.       Assign the integer or string constant operands into successive
  188.       bytes of memory in the current section. Any combination of integer
  189.       and character string constant operands is permitted.
  190.  
  191.       .comm <symbol>,<size>
  192.       ---------------------
  193.       Allocate <size> bytes of space in the .bss section and assign
  194.       the value to that location to <symbol>. <symbol> is always made
  195.       globally visible. ".comm"-areas of less than 8 bytes in size are
  196.       aligned to word boundaries, otherwise to doubleword boundaries.
  197.  
  198.       .double <float1>[,<float2>...]
  199.       ------------------------------
  200.       If the current section location counter is not on a doubleword
  201.       boundary advance it to the next doubleword boundary. Then assign
  202.       the values of the operands as IEEE 754 double-precision 64-bit
  203.       format numbers to successive doublewords of memory in the current
  204.       section.
  205.  
  206.       .else
  207.       -----
  208.       Begins the "else"-part in a block of conditional assembly.
  209.  
  210.       .endif
  211.       ------
  212.       Ends a block of conditional assembly.
  213.  
  214.       .endm
  215.       -----
  216.       Ends a macro definition.
  217.  
  218.       .extern <symbol>
  219.       ----------------
  220.       See ".globl".
  221.  
  222.       .fail
  223.       -----
  224.       Abort assembly with displaying the error message "fail directive
  225.       encountered".
  226.  
  227.       .file "<file name>"
  228.       -------------------
  229.       Specify the source file name, which is included into the ELF object
  230.       file as a symbol of type "FILE" with local binding. In EHF objects,
  231.       it is used as unit name.
  232.  
  233.       .float <float1>[,<float2>...]
  234.       -----------------------------
  235.       If the current section location counter is not on a word boundary
  236.       advance it to the next word boundary. Then assign the values of the
  237.       operands as IEEE 754 single precision 32-bit format numbers to
  238.       successive words of memory in the current section.
  239.  
  240.       .global <symbol>
  241.       ----------------
  242.       See ".globl".
  243.  
  244.       .globl <symbol>
  245.       ---------------
  246.       Flag <symbol> as an external symbol, which means that <symbol> is
  247.       visible to all modules in the linking process. It may be either
  248.       defined or undefined.
  249.  
  250.       .half <exp1>[,<exp2>...]
  251.       ------------------------
  252.       If the current section location counter is not on a halfword
  253.       boundary, advance it to the next halfword boundary. Then, assign
  254.       the values of the operands into successive halfwords of memory in
  255.       the current section.
  256.  
  257.       .ident "<string>"
  258.       -----------------
  259.       Place an indentification string into the .comment section (ELF).
  260.  
  261.       .if<cond> <exp>
  262.       ---------------
  263.       The following block will only be assembled, if the condition <cond>
  264.       is valid for the expression <exp>. Available conditions are:
  265.       .if     assemble, if <exp> is not zero.
  266.       .ifeq   assemble, if <exp> is zero.
  267.       .ifne   assemble, if <exp> is not zero.
  268.       .ifgt   assemble, if <exp> is greater than zero.
  269.       .ifge   assemble, if <exp> is greater than zero or equal (positive).
  270.       .iflt   assemble, if <exp> is less than zero (negative).
  271.       .ifle   assemble, if <exp> is less than zero or equal.
  272.       .ifdef  assemble, if <exp> is defined.
  273.       .ifndef assemble, if <exp> is undefined.
  274.       A block of conditional assembly is ended by ".endif". A maximum of
  275.       eight if-levels is allowed.
  276.  
  277.       .include <file name>
  278.       --------------------
  279.       Includes another source text. Besides the current directory, all
  280.       include paths defined by the -I option are searched.
  281.  
  282.       .lcomm <symbol>,<size>[,<alignment>]
  283.       ------------------------------------
  284.       See ".bss".
  285.  
  286.       .local <symbol>
  287.       ---------------
  288.       Explicitely declare symbol to have local binding. It is not
  289.       visible outside the object file containing its definition.
  290.       <symbol> must be known (ELF only).
  291.  
  292.       .long <exp1>[,<exp2>...]
  293.       ------------------------
  294.       See ".word".
  295.  
  296.       .macro <name>
  297.       -------------
  298.       Define a new macro, called <name>. Macro parameters can be acces-
  299.       sed by \1 to \9. \0 is reserved for the branch hint. Example:
  300.       .macro  bdz
  301.               bc\0   18,0,\1
  302.       .endm
  303.       \@ will be replaced by a unique number on every macro invocation
  304.       and should be used when defining labels in a macro.
  305.  
  306.       .newsection <name>[,"<attributes>"]
  307.       -----------------------------------
  308.       This directives differs from the normal .section directive in the
  309.       case if a section called <name> already exists. .newsection will
  310.       then force the start of a new section with the same name and
  311.       effectively ends any further definition for the earlier section.
  312.       For the rest, see ".section".
  313.  
  314.       .sdreg <base_reg>
  315.       -----------------------------
  316.       Set a base register (r2-r31) for small data access. This enables
  317.       auto detection of base relative data access. The normal method
  318.       to create a R_PPC_SDAREL16 relocation would be:
  319.         lwz    r3,variable@sdarx(r13)   # r13: small data base reg.
  320.  
  321.       .section <name>[,"<attributes>"]
  322.       --------------------------------
  323.       Starts a new section named <name> or reactivate an old one. If
  324.       attributes are given for an already existing section, they must
  325.       match exactly. The section's name will also be defined as a new
  326.       symbol, which represents the section's start address.
  327.       The "<attributes>" string may consist of the following characters:
  328.       Section Contents:
  329.             c - section has code
  330.             d - section has initialized data
  331.             u - section has uninitialized data
  332.             i - section has directives (info section)
  333.             n - section can be discarded
  334.             R - remove section at link time
  335.       Section Protection:
  336.             r - section is readable
  337.             w - section is writable
  338.             x - section is executable
  339.             s - section is sharable
  340.       Section Alignment (only one):
  341.             0 - align to byte boundary
  342.             1 - align to halfword boundary
  343.             2 - align to word boundary
  344.             3 - align to doubleword boundary
  345.             4 - align to quadword boundary
  346.             5 - align to 32 byte boundary
  347.             6 - align to 64 byte boundary
  348.       Memory flags (EHF and ADOS only):
  349.             C - load section to Chip RAM
  350.             F - load section to Fast RAM
  351.  
  352.       .set <symbol>,<expression>
  353.       --------------------------
  354.       Create a new program symbol with the name <symbol> and assign to it
  355.       the value of <expression>. If <symbol> is already assigned, it will
  356.       contain a new value from now on. If <expression> is undefined in
  357.       pass 1 (because symbols in it are defined some lines later) it will
  358.       get a default value of '1', which is changed in pass 2 to the
  359.       correct value. So it is visible for .ifdef, etc.
  360.  
  361.       .size <symbol>,<size>
  362.       ---------------------
  363.       Set the size in bytes of an object defined at <symbol>.
  364.  
  365.       .short <exp1>[,<exp2>...]
  366.       -------------------------
  367.       See ".half".
  368.  
  369.       .space <exp>
  370.       ------------
  371.       Insert <exp> zero bytes into the current section.
  372.  
  373.       .string "<string1>"[,"<string2>"...]
  374.       ------------------------------------
  375.       Assign the characters in each string along with a final zero byte
  376.       to successive memory locations in the current section.
  377.  
  378.       .type <symbol>,<type>
  379.       ---------------------
  380.       Set type of symbol called <symbol> to <type>, which must be one of:
  381.       1: Object
  382.       2: Function
  383.       3: Section
  384.       4: File
  385.       The predefined symbols @object and @function are available for
  386.       this purpose.
  387.  
  388.       .uadouble <float1>[,<float2>...]
  389.       --------------------------------
  390.       Assign the values of the operands as IEEE 754 double-precision 64-
  391.       bit format numbers to successive eight-byte areas of memory in the
  392.       current section regardless of section alignment.
  393.  
  394.       .uafloat <float1>[,<float2>...]
  395.       -------------------------------
  396.       Assign the values of the operands as IEEE 754 single precision 32-
  397.       bit format numbers to successive 4-byte areas of memory in the
  398.       current section regardless of section alignment.
  399.  
  400.       .uahalf <exp1>[,<exp2>...]
  401.       --------------------------
  402.       Assign the values of the operands into successive two byte areas of
  403.       memory in the current section regardless of section alignment.
  404.  
  405.       .ualong <exp1>[,<exp2>...]
  406.       --------------------------
  407.       See ".uaword".
  408.  
  409.       .uashort <exp1>[,<exp2>...]
  410.       ---------------------------
  411.       See ".uahalf".
  412.  
  413.       .uaword <exp1>[,<exp2>...]
  414.       --------------------------
  415.       Assign the values of the operands into successive four-byte areas
  416.       of memory in the current section regardless of section alignment.
  417.  
  418.       .word <exp1>[,<exp2>...]
  419.       ------------------------
  420.       If the current section location counter is not on a word boundary
  421.       advance it to the next word boundary. Then assign the values of the
  422.       operands into successive words of memory in the current section.
  423.  
  424.  
  425. PREDEFINED SYMBOLS
  426.       There are two symbols, which are always updated by the assembler.
  427.       $       Current address counter value.
  428.       $NARG   Number of macro arguments during macro execution.
  429.               It is zero, when outside of a macro.
  430.  
  431.       The following symbols are constant and may be deactivated by
  432.       specifying the -R option.
  433.               .set r0,0
  434.               .set r1,1
  435.               .set r2,2
  436.               .set r3,3
  437.               .set r4,4
  438.               .set r5,5
  439.               .set r6,6
  440.               .set r7,7
  441.               .set r8,8
  442.               .set r9,9
  443.               .set r10,10
  444.               .set r11,11
  445.               .set r12,12
  446.               .set r13,13
  447.               .set r14,14
  448.               .set r15,15
  449.               .set r16,16
  450.               .set r17,17
  451.               .set r18,18
  452.               .set r19,19
  453.               .set r20,20
  454.               .set r21,21
  455.               .set r22,22
  456.               .set r23,23
  457.               .set r24,24
  458.               .set r25,25
  459.               .set r26,26
  460.               .set r27,27
  461.               .set r28,28
  462.               .set r29,29
  463.               .set r30,30
  464.               .set r31,31
  465.               .set f0,0
  466.               .set f1,1
  467.               .set f2,2
  468.               .set f3,3
  469.               .set f4,4
  470.               .set f5,5
  471.               .set f6,6
  472.               .set f7,7
  473.               .set f8,8
  474.               .set f9,9
  475.               .set f10,10
  476.               .set f11,11
  477.               .set f12,12
  478.               .set f13,13
  479.               .set f14,14
  480.               .set f15,15
  481.               .set f16,16
  482.               .set f17,17
  483.               .set f18,18
  484.               .set f19,19
  485.               .set f20,20
  486.               .set f21,21
  487.               .set f22,22
  488.               .set f23,23
  489.               .set f24,24
  490.               .set f25,25
  491.               .set f26,26
  492.               .set f27,27
  493.               .set f28,28
  494.               .set f29,29
  495.               .set f30,30
  496.               .set f31,31
  497.               .set cr0,0
  498.               .set cr1,1
  499.               .set cr2,2
  500.               .set cr3,3
  501.               .set cr4,4
  502.               .set cr5,5
  503.               .set cr6,6
  504.               .set cr7,7
  505.               .set lt,0
  506.               .set gt,1
  507.               .set eq,2
  508.               .set so,3
  509.               .set un,3
  510.               .set sp,1
  511.               .set rtoc,2
  512.               .set fp,31
  513.               .set fpscr,0
  514.               .set xer,1
  515.               .set lr,8
  516.               .set ctr,9
  517.  
  518.  
  519. PREDEFINED SECTIONS
  520.         .section .text,"crx4"
  521.         .section .data,"drw4"
  522.         .section .rodata,"dr4"
  523.         .section .sdata,"drw4"
  524.         .section .sdata2,"dr4"
  525.         .section .bss,"urw4"
  526.         .section .sbss,"urw4"
  527.         .section .init,"crx4"
  528.         .section .fini,"crx4"
  529.         .section .tocd,"drw4"
  530.  
  531.  
  532. EXTENDED MNEMONICS
  533.       There is a huge set of extended mnemonics, proposed by Motorola
  534.       and IBM in the "PowerPC Programming Environments", to make the
  535.       programmer's life easier. Except for some 64-bit mnemonics (I only
  536.       downloaded the 32-bit manuals for now), pasm supports them all.
  537.  
  538.       Currently all extended mnemonics (except "la") are implemented
  539.       as macros and can be deactivated with the -X option.
  540.  
  541.       List of extended mnemonics
  542.       --------------------------
  543.       .macro subi
  544.        addi \1,\2,-(\3)
  545.       .endm
  546.       
  547.       .macro subis
  548.        addis \1,\2,-(\3)
  549.       .endm
  550.       
  551.       .macro subic
  552.        addic \1,\2,-(\3)
  553.       .endm
  554.       
  555.       .macro subic.
  556.        addic. \1,\2,-(\3)
  557.       .endm
  558.       
  559.       .macro sub
  560.        subf \1,\3,\2
  561.       .endm
  562.       
  563.       .macro sub.
  564.        subf. \1,\3,\2
  565.       .endm
  566.       
  567.       .macro subo
  568.        subfo \1,\3,\2
  569.       .endm
  570.       
  571.       .macro subo.
  572.        subfo. \1,\3,\2
  573.       .endm
  574.       
  575.       .macro subc
  576.        subfc \1,\3,\2
  577.       .endm
  578.       
  579.       .macro subc.
  580.        subfc. \1,\3,\2
  581.       .endm
  582.       
  583.       .macro subco
  584.        subfco \1,\3,\2
  585.       .endm
  586.       
  587.       .macro subco.
  588.        subfco. \1,\3,\2
  589.       .endm
  590.       
  591.       .macro cmpwi
  592.       .ifeq $NARG-2
  593.        cmpi 0,0,\1,\2
  594.       .else
  595.        cmpi \1,0,\2,\3
  596.       .endif
  597.       .endm
  598.       
  599.       .macro cmpw
  600.       .ifeq $NARG-2
  601.        cmp 0,0,\1,\2
  602.       .else
  603.        cmp \1,0,\2,\3
  604.       .endif
  605.       .endm
  606.       
  607.       .macro cmplwi
  608.       .ifeq $NARG-2
  609.        cmpli 0,0,\1,\2
  610.       .else
  611.        cmpli \1,0,\2,\3
  612.       .endif
  613.       .endm
  614.       
  615.       .macro cmplw
  616.       .ifeq $NARG-2
  617.        cmpl 0,0,\1,\2
  618.       .else
  619.        cmpl \1,0,\2,\3
  620.       .endif
  621.       .endm
  622.       
  623.       .macro cmpdi
  624.       .ifeq $NARG-2
  625.        cmpi 0,1,\1,\2
  626.       .else
  627.        cmpi \1,1,\2,\3
  628.       .endif
  629.       .endm
  630.       
  631.       .macro cmpd
  632.       .ifeq $NARG-2
  633.        cmp 0,1,\1,\2
  634.       .else
  635.        cmp \1,1,\2,\3
  636.       .endif
  637.       .endm
  638.       
  639.       .macro cmpldi
  640.       .ifeq $NARG-2
  641.        cmpli 0,1,\1,\2
  642.       .else
  643.        cmpli \1,1,\2,\3
  644.       .endif
  645.       .endm
  646.       
  647.       .macro cmpld
  648.       .ifeq $NARG-2
  649.        cmpl 0,1,\1,\2
  650.       .else
  651.        cmpl \1,1,\2,\3
  652.       .endif
  653.       .endm
  654.       
  655.       
  656.       .macro extlwi
  657.        rlwinm \1,\2,\4,0,(\3)-1
  658.       .endm
  659.       
  660.       .macro extlwi.
  661.        rlwinm. \1,\2,\4,0,(\3)-1
  662.       .endm
  663.       
  664.       .macro extrwi
  665.        rlwinm \1,\2,(\4)+(\3),32-(\3),31
  666.       .endm
  667.       
  668.       .macro extrwi.
  669.        rlwinm. \1,\2,(\4)+(\3),32-(\3),31
  670.       .endm
  671.       
  672.       .macro inslwi
  673.        rlwimi \1,\2,32-(\4),\4,((\4)+(\3))-1
  674.       .endm
  675.       
  676.       .macro inslwi.
  677.        rlwimi. \1,\2,32-(\4),\4,((\4)+(\3))-1
  678.       .endm
  679.       
  680.       .macro insrwi
  681.        rlwimi \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  682.       .endm
  683.       
  684.       .macro insrwi.
  685.        rlwimi. \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  686.       .endm
  687.       
  688.       .macro rotlwi
  689.        rlwinm \1,\2,\3,0,31
  690.       .endm
  691.       
  692.       .macro rotlwi.
  693.        rlwinm. \1,\2,\3,0,31
  694.       .endm
  695.       
  696.       .macro rotrwi
  697.        rlwinm \1,\2,32-(\3),0,31
  698.       .endm
  699.       
  700.       .macro rotrwi.
  701.        rlwinm. \1,\2,32-(\3),0,31
  702.       .endm
  703.       
  704.       .macro rotlw
  705.        rlwnm \1,\2,\3,0,31
  706.       .endm
  707.       
  708.       .macro rotlw.
  709.        rlwnm. \1,\2,\3,0,31
  710.       .endm
  711.       
  712.       .macro slwi
  713.        rlwinm \1,\2,\3,0,31-(\3)
  714.       .endm
  715.       
  716.       .macro slwi.
  717.        rlwinm. \1,\2,\3,0,31-(\3)
  718.       .endm
  719.       
  720.       .macro srwi
  721.        rlwinm \1,\2,32-(\3),\3,31
  722.       .endm
  723.       
  724.       .macro srwi.
  725.        rlwinm. \1,\2,32-(\3),\3,31
  726.       .endm
  727.       
  728.       .macro clrlwi
  729.        rlwinm \1,\2,0,\3,31
  730.       .endm
  731.       
  732.       .macro clrlwi.
  733.        rlwinm. \1,\2,0,\3,31
  734.       .endm
  735.       
  736.       .macro clrrwi
  737.        rlwinm \1,\2,0,0,31-(\3)
  738.       .endm
  739.       
  740.       .macro clrrwi.
  741.        rlwinm. \1,\2,0,0,31-(\3)
  742.       .endm
  743.       
  744.       .macro clrlslwi
  745.        rlwinm \1,\2,\4,(\3)-(\4),31-(\4)
  746.       .endm
  747.       
  748.       .macro clrlslwi.
  749.        rlwinm. \1,\2,\4,(\3)-(\4),31-(\4)
  750.       .endm
  751.       
  752.       
  753.       .macro bt
  754.        bc\0 12,\1,\2
  755.       .endm
  756.       
  757.       .macro bf
  758.        bc\0 4,\1,\2
  759.       .endm
  760.       
  761.       .macro bdnz
  762.        bc\0 16,0,\1
  763.       .endm
  764.       
  765.       .macro bdnzt
  766.        bc\0 8,\1,\2
  767.       .endm
  768.       
  769.       .macro bdnzf
  770.        bc\0 0,\1,\2
  771.       .endm
  772.       
  773.       .macro bdz
  774.        bc\0 18,0,\1
  775.       .endm
  776.       
  777.       .macro bdzt
  778.        bc\0 10,\1,\2
  779.       .endm
  780.       
  781.       .macro bdzf
  782.        bc\0 2,\1,\2
  783.       .endm
  784.       
  785.       .macro bta
  786.        bca\0 12,\1,\2
  787.       .endm
  788.       
  789.       .macro bfa
  790.        bca\0 4,\1,\2
  791.       .endm
  792.       
  793.       .macro bdnza
  794.        bca\0 16,0,\1
  795.       .endm
  796.       
  797.       .macro bdnzta
  798.        bca\0 8,\1,\2
  799.       .endm
  800.       
  801.       .macro bdnzfa
  802.        bca\0 0,\1,\2
  803.       .endm
  804.       
  805.       .macro bdza
  806.        bca\0 18,0,\1
  807.       .endm
  808.       
  809.       .macro bdzta
  810.        bca\0 10,\1,\2
  811.       .endm
  812.       
  813.       .macro bdzfa
  814.        bca\0 2,\1,\2
  815.       .endm
  816.       
  817.       .macro blr
  818.        bclr 20,0
  819.       .endm
  820.       
  821.       .macro btlr
  822.        bclr\0 12,\1
  823.       .endm
  824.       
  825.       .macro bflr
  826.        bclr\0 4,\1
  827.       .endm
  828.       
  829.       .macro bdnzlr
  830.        bclr\0 16,0
  831.       .endm
  832.       
  833.       .macro bdnztlr
  834.        bclr\0 8,\1
  835.       .endm
  836.       
  837.       .macro bdnzflr
  838.        bclr\0 0,\1
  839.       .endm
  840.       
  841.       .macro bdzlr
  842.        bclr\0 18,0
  843.       .endm
  844.       
  845.       .macro bdztlr
  846.        bclr\0 10,\1
  847.       .endm
  848.       
  849.       .macro bdzflr
  850.        bclr\0 2,\1
  851.       .endm
  852.       
  853.       .macro bctr
  854.        bcctr 20,0
  855.       .endm
  856.       
  857.       .macro btctr
  858.        bcctr\0 12,\1
  859.       .endm
  860.       
  861.       .macro bfctr
  862.        bcctr\0 4,\1
  863.       .endm
  864.       
  865.       .macro btl
  866.        bcl\0 12,\1,\2
  867.       .endm
  868.       
  869.       .macro bfl
  870.        bcl\0 4,\1,\2
  871.       .endm
  872.       
  873.       .macro bdnzl
  874.        bcl\0 16,0,\1
  875.       .endm
  876.       
  877.       .macro bdnztl
  878.        bcl\0 8,\1,\2
  879.       .endm
  880.       
  881.       .macro bdnzfl
  882.        bcl\0 0,\1,\2
  883.       .endm
  884.       
  885.       .macro bdzl
  886.        bcl\0 18,0,\1
  887.       .endm
  888.       
  889.       .macro bdztl
  890.        bcl\0 10,\1,\2
  891.       .endm
  892.       
  893.       .macro bdzfl
  894.        bcl\0 2,\1,\2
  895.       .endm
  896.       
  897.       .macro btla
  898.        bcla\0 12,\1,\2
  899.       .endm
  900.       
  901.       .macro bfla
  902.        bcla\0 4,\1,\2
  903.       .endm
  904.       
  905.       .macro bdnzla
  906.        bcla\0 16,0,\1
  907.       .endm
  908.       
  909.       .macro bdnztla
  910.        bcla\0 8,\1,\2
  911.       .endm
  912.       
  913.       .macro bdnzfla
  914.        bcla\0 0,\1,\2
  915.       .endm
  916.       
  917.       .macro bdzla
  918.        bcla\0 18,0,\1
  919.       .endm
  920.       
  921.       .macro bdztla
  922.        bcla\0 10,\1,\2
  923.       .endm
  924.       
  925.       .macro bdzfla
  926.        bcla\0 2,\1,\2
  927.       .endm
  928.       
  929.       .macro blrl
  930.        bclrl 20,0
  931.       .endm
  932.       
  933.       .macro btlrl
  934.        bclrl\0 12,\1
  935.       .endm
  936.       
  937.       .macro bflrl
  938.        bclrl\0 4,\1
  939.       .endm
  940.       
  941.       .macro bdnzlrl
  942.        bclrl\0 16,0
  943.       .endm
  944.       
  945.       .macro bdnztlrl
  946.        bclrl\0 8,\1
  947.       .endm
  948.       
  949.       .macro bdnzflrl
  950.        bclrl\0 0,\1
  951.       .endm
  952.       
  953.       .macro bdzlrl
  954.        bclrl\0 18,0
  955.       .endm
  956.       
  957.       .macro bdztlrl
  958.        bclrl\0 10,\1
  959.       .endm
  960.       
  961.       .macro bdzflrl
  962.        bclrl\0 2,\1
  963.       .endm
  964.       
  965.       .macro bctrl
  966.        bcctrl 20,0
  967.       .endm
  968.       
  969.       .macro btctrl
  970.        bcctrl\0 12,\1
  971.       .endm
  972.       
  973.       .macro bfctrl
  974.        bcctrl\0 4,\1
  975.       .endm
  976.       
  977.       
  978.       .macro blt
  979.       .ifeq $NARG-1
  980.        bc\0 12,0,\1
  981.       .else
  982.        bc\0 12,4*(\1)+0,\2
  983.       .endif
  984.       .endm
  985.       
  986.       .macro ble
  987.       .ifeq $NARG-1
  988.        bc\0 4,1,\1
  989.       .else
  990.        bc\0 4,4*(\1)+1,\2
  991.       .endif
  992.       .endm
  993.       
  994.       .macro beq
  995.       .ifeq $NARG-1
  996.        bc\0 12,2,\1
  997.       .else
  998.        bc\0 12,4*(\1)+2,\2
  999.       .endif
  1000.       .endm
  1001.       
  1002.       .macro bge
  1003.       .ifeq $NARG-1
  1004.        bc\0 4,0,\1
  1005.       .else
  1006.        bc\0 4,4*(\1)+0,\2
  1007.       .endif
  1008.       .endm
  1009.       
  1010.       .macro bgt
  1011.       .ifeq $NARG-1
  1012.        bc\0 12,1,\1
  1013.       .else
  1014.        bc\0 12,4*(\1)+1,\2
  1015.       .endif
  1016.       .endm
  1017.       
  1018.       .macro bnl
  1019.       .ifeq $NARG-1
  1020.        bc\0 4,0,\1
  1021.       .else
  1022.        bc\0 4,4*(\1)+0,\2
  1023.       .endif
  1024.       .endm
  1025.       
  1026.       .macro bne
  1027.       .ifeq $NARG-1
  1028.        bc\0 4,2,\1
  1029.       .else
  1030.        bc\0 4,4*(\1)+2,\2
  1031.       .endif
  1032.       .endm
  1033.       
  1034.       .macro bng
  1035.       .ifeq $NARG-1
  1036.        bc\0 4,1,\1
  1037.       .else
  1038.        bc\0 4,4*(\1)+1,\2
  1039.       .endif
  1040.       .endm
  1041.       
  1042.       .macro bso
  1043.       .ifeq $NARG-1
  1044.        bc\0 12,3,\1
  1045.       .else
  1046.        bc\0 12,4*(\1)+3,\2
  1047.       .endif
  1048.       .endm
  1049.       
  1050.       .macro bns
  1051.       .ifeq $NARG-1
  1052.        bc\0 4,3,\1
  1053.       .else
  1054.        bc\0 4,4*(\1)+3,\2
  1055.       .endif
  1056.       .endm
  1057.       
  1058.       .macro bun
  1059.       .ifeq $NARG-1
  1060.        bc\0 12,3,\1
  1061.       .else
  1062.        bc\0 12,4*(\1)+3,\2
  1063.       .endif
  1064.       .endm
  1065.       
  1066.       .macro bnu
  1067.       .ifeq $NARG-1
  1068.        bc\0 4,3,\1
  1069.       .else
  1070.        bc\0 4,4*(\1)+3,\2
  1071.       .endif
  1072.       .endm
  1073.       
  1074.       .macro blta
  1075.       .ifeq $NARG-1
  1076.        bca\0 12,0,\1
  1077.       .else
  1078.        bca\0 12,4*(\1)+0,\2
  1079.       .endif
  1080.       .endm
  1081.       
  1082.       .macro blea
  1083.       .ifeq $NARG-1
  1084.        bca\0 4,1,\1
  1085.       .else
  1086.        bca\0 4,4*(\1)+1,\2
  1087.       .endif
  1088.       .endm
  1089.       
  1090.       .macro beqa
  1091.       .ifeq $NARG-1
  1092.        bca\0 12,2,\1
  1093.       .else
  1094.        bca\0 12,4*(\1)+2,\2
  1095.       .endif
  1096.       .endm
  1097.       
  1098.       .macro bgea
  1099.       .ifeq $NARG-1
  1100.        bca\0 4,0,\1
  1101.       .else
  1102.        bca\0 4,4*(\1)+0,\2
  1103.       .endif
  1104.       .endm
  1105.       
  1106.       .macro bgta
  1107.       .ifeq $NARG-1
  1108.        bca\0 12,1,\1
  1109.       .else
  1110.        bca\0 12,4*(\1)+1,\2
  1111.       .endif
  1112.       .endm
  1113.       
  1114.       .macro bnla
  1115.       .ifeq $NARG-1
  1116.        bca\0 4,0,\1
  1117.       .else
  1118.        bca\0 4,4*(\1)+0,\2
  1119.       .endif
  1120.       .endm
  1121.       
  1122.       .macro bnea
  1123.       .ifeq $NARG-1
  1124.        bca\0 4,2,\1
  1125.       .else
  1126.        bca\0 4,4*(\1)+2,\2
  1127.       .endif
  1128.       .endm
  1129.       
  1130.       .macro bnga
  1131.       .ifeq $NARG-1
  1132.        bca\0 4,1,\1
  1133.       .else
  1134.        bca\0 4,4*(\1)+1,\2
  1135.       .endif
  1136.       .endm
  1137.       
  1138.       .macro bsoa
  1139.       .ifeq $NARG-1
  1140.        bca\0 12,3,\1
  1141.       .else
  1142.        bca\0 12,4*(\1)+3,\2
  1143.       .endif
  1144.       .endm
  1145.       
  1146.       .macro bnsa
  1147.       .ifeq $NARG-1
  1148.        bca\0 4,3,\1
  1149.       .else
  1150.        bca\0 4,4*(\1)+3,\2
  1151.       .endif
  1152.       .endm
  1153.       
  1154.       .macro buna
  1155.       .ifeq $NARG-1
  1156.        bca\0 12,3,\1
  1157.       .else
  1158.        bca\0 12,4*(\1)+3,\2
  1159.       .endif
  1160.       .endm
  1161.       
  1162.       .macro bnua
  1163.       .ifeq $NARG-1
  1164.        bca\0 4,3,\1
  1165.       .else
  1166.        bca\0 4,4*(\1)+3,\2
  1167.       .endif
  1168.       .endm
  1169.       
  1170.       
  1171.       .macro bltlr
  1172.       .ifeq $NARG-1
  1173.        bclr\0 12,4*(\1)+0
  1174.       .else
  1175.        bclr\0 12,0
  1176.       .endif
  1177.       .endm
  1178.       
  1179.       .macro blelr
  1180.       .ifeq $NARG-1
  1181.        bclr\0 4,4*(\1)+1
  1182.       .else
  1183.        bclr\0 4,1
  1184.       .endif
  1185.       .endm
  1186.       
  1187.       .macro beqlr
  1188.       .ifeq $NARG-1
  1189.        bclr\0 12,4*(\1)+2
  1190.       .else
  1191.        bclr\0 12,2
  1192.       .endif
  1193.       .endm
  1194.       
  1195.       .macro bgelr
  1196.       .ifeq $NARG-1
  1197.        bclr\0 4,4*(\1)+0
  1198.       .else
  1199.        bclr\0 4,0
  1200.       .endif
  1201.       .endm
  1202.       
  1203.       .macro bgtlr
  1204.       .ifeq $NARG-1
  1205.        bclr\0 12,4*(\1)+1
  1206.       .else
  1207.        bclr\0 12,1
  1208.       .endif
  1209.       .endm
  1210.       
  1211.       .macro bnllr
  1212.       .ifeq $NARG-1
  1213.        bclr\0 4,4*(\1)+0
  1214.       .else
  1215.        bclr\0 4,0
  1216.       .endif
  1217.       .endm
  1218.       
  1219.       .macro bnelr
  1220.       .ifeq $NARG-1
  1221.        bclr\0 4,4*(\1)+2
  1222.       .else
  1223.        bclr\0 4,2
  1224.       .endif
  1225.       .endm
  1226.       
  1227.       .macro bnglr
  1228.       .ifeq $NARG-1
  1229.        bclr\0 4,4*(\1)+1
  1230.       .else
  1231.        bclr\0 4,1
  1232.       .endif
  1233.       .endm
  1234.       
  1235.       .macro bsolr
  1236.       .ifeq $NARG-1
  1237.        bclr\0 12,4*(\1)+3
  1238.       .else
  1239.        bclr\0 12,3
  1240.       .endif
  1241.       .endm
  1242.       
  1243.       .macro bnslr
  1244.       .ifeq $NARG-1
  1245.        bclr\0 4,4*(\1)+3
  1246.       .else
  1247.        bclr\0 4,3
  1248.       .endif
  1249.       .endm
  1250.       
  1251.       .macro bunlr
  1252.       .ifeq $NARG-1
  1253.        bclr\0 12,4*(\1)+3
  1254.       .else
  1255.        bclr\0 12,3
  1256.       .endif
  1257.       .endm
  1258.       
  1259.       .macro bnulr
  1260.       .ifeq $NARG-1
  1261.        bclr\0 4,4*(\1)+3
  1262.       .else
  1263.        bclr\0 4,3
  1264.       .endif
  1265.       .endm
  1266.       
  1267.       .macro bltctr
  1268.       .ifeq $NARG-1
  1269.        bcctr\0 12,4*(\1)+0
  1270.       .else
  1271.        bcctr\0 12,0
  1272.       .endif
  1273.       .endm
  1274.       
  1275.       .macro blectr
  1276.       .ifeq $NARG-1
  1277.        bcctr\0 4,4*(\1)+1
  1278.       .else
  1279.        bcctr\0 4,1
  1280.       .endif
  1281.       .endm
  1282.       
  1283.       .macro beqctr
  1284.       .ifeq $NARG-1
  1285.        bcctr\0 12,4*(\1)+2
  1286.       .else
  1287.        bcctr\0 12,2
  1288.       .endif
  1289.       .endm
  1290.       
  1291.       .macro bgectr
  1292.       .ifeq $NARG-1
  1293.        bcctr\0 4,4*(\1)+0
  1294.       .else
  1295.        bcctr\0 4,0
  1296.       .endif
  1297.       .endm
  1298.       
  1299.       .macro bgtctr
  1300.       .ifeq $NARG-1
  1301.        bcctr\0 12,4*(\1)+1
  1302.       .else
  1303.        bcctr\0 12,1
  1304.       .endif
  1305.       .endm
  1306.       
  1307.       .macro bnlctr
  1308.       .ifeq $NARG-1
  1309.        bcctr\0 4,4*(\1)+0
  1310.       .else
  1311.        bcctr\0 4,0
  1312.       .endif
  1313.       .endm
  1314.       
  1315.       .macro bnectr
  1316.       .ifeq $NARG-1
  1317.        bcctr\0 4,4*(\1)+2
  1318.       .else
  1319.        bcctr\0 4,2
  1320.       .endif
  1321.       .endm
  1322.       
  1323.       .macro bngctr
  1324.       .ifeq $NARG-1
  1325.        bcctr\0 4,4*(\1)+1
  1326.       .else
  1327.        bcctr\0 4,1
  1328.       .endif
  1329.       .endm
  1330.       
  1331.       .macro bsoctr
  1332.       .ifeq $NARG-1
  1333.        bcctr\0 12,4*(\1)+3
  1334.       .else
  1335.        bcctr\0 12,3
  1336.       .endif
  1337.       .endm
  1338.       
  1339.       .macro bnsctr
  1340.       .ifeq $NARG-1
  1341.        bcctr\0 4,4*(\1)+3
  1342.       .else
  1343.        bcctr\0 4,3
  1344.       .endif
  1345.       .endm
  1346.       
  1347.       .macro bunctr
  1348.       .ifeq $NARG-1
  1349.        bcctr\0 12,4*(\1)+3
  1350.       .else
  1351.        bcctr\0 12,3
  1352.       .endif
  1353.       .endm
  1354.       
  1355.       .macro bnuctr
  1356.       .ifeq $NARG-1
  1357.        bcctr\0 4,4*(\1)+3
  1358.       .else
  1359.        bcctr\0 4,3
  1360.       .endif
  1361.       .endm
  1362.       
  1363.       
  1364.       .macro bltl
  1365.       .ifeq $NARG-1
  1366.        bcl\0 12,0,\1
  1367.       .else
  1368.        bcl\0 12,4*(\1)+0,\2
  1369.       .endif
  1370.       .endm
  1371.       
  1372.       .macro blel
  1373.       .ifeq $NARG-1
  1374.        bcl\0 4,1,\1
  1375.       .else
  1376.        bcl\0 4,4*(\1)+1,\2
  1377.       .endif
  1378.       .endm
  1379.       
  1380.       .macro beql
  1381.       .ifeq $NARG-1
  1382.        bcl\0 12,2,\1
  1383.       .else
  1384.        bcl\0 12,4*(\1)+2,\2
  1385.       .endif
  1386.       .endm
  1387.       
  1388.       .macro bgel
  1389.       .ifeq $NARG-1
  1390.        bcl\0 4,0,\1
  1391.       .else
  1392.        bcl\0 4,4*(\1)+0,\2
  1393.       .endif
  1394.       .endm
  1395.       
  1396.       .macro bgtl
  1397.       .ifeq $NARG-1
  1398.        bcl\0 12,1,\1
  1399.       .else
  1400.        bcl\0 12,4*(\1)+1,\2
  1401.       .endif
  1402.       .endm
  1403.       
  1404.       .macro bnll
  1405.       .ifeq $NARG-1
  1406.        bcl\0 4,0,\1
  1407.       .else
  1408.        bcl\0 4,4*(\1)+0,\2
  1409.       .endif
  1410.       .endm
  1411.       
  1412.       .macro bnel
  1413.       .ifeq $NARG-1
  1414.        bcl\0 4,2,\1
  1415.       .else
  1416.        bcl\0 4,4*(\1)+2,\2
  1417.       .endif
  1418.       .endm
  1419.       
  1420.       .macro bngl
  1421.       .ifeq $NARG-1
  1422.        bcl\0 4,1,\1
  1423.       .else
  1424.        bcl\0 4,4*(\1)+1,\2
  1425.       .endif
  1426.       .endm
  1427.       
  1428.       .macro bsol
  1429.       .ifeq $NARG-1
  1430.        bcl\0 12,3,\1
  1431.       .else
  1432.        bcl\0 12,4*(\1)+3,\2
  1433.       .endif
  1434.       .endm
  1435.       
  1436.       .macro bnsl
  1437.       .ifeq $NARG-1
  1438.        bcl\0 4,3,\1
  1439.       .else
  1440.        bcl\0 4,4*(\1)+3,\2
  1441.       .endif
  1442.       .endm
  1443.       
  1444.       .macro bunl
  1445.       .ifeq $NARG-1
  1446.        bcl\0 12,3,\1
  1447.       .else
  1448.        bcl\0 12,4*(\1)+3,\2
  1449.       .endif
  1450.       .endm
  1451.       
  1452.       .macro bnul
  1453.       .ifeq $NARG-1
  1454.        bcl\0 4,3,\1
  1455.       .else
  1456.        bcl\0 4,4*(\1)+3,\2
  1457.       .endif
  1458.       .endm
  1459.       
  1460.       .macro bltla
  1461.       .ifeq $NARG-1
  1462.        bcla\0 12,0,\1
  1463.       .else
  1464.        bcla\0 12,4*(\1)+0,\2
  1465.       .endif
  1466.       .endm
  1467.       
  1468.       .macro blela
  1469.       .ifeq $NARG-1
  1470.        bcla\0 4,1,\1
  1471.       .else
  1472.        bcla\0 4,4*(\1)+1,\2
  1473.       .endif
  1474.       .endm
  1475.       
  1476.       .macro beqla
  1477.       .ifeq $NARG-1
  1478.        bcla\0 12,2,\1
  1479.       .else
  1480.        bcla\0 12,4*(\1)+2,\2
  1481.       .endif
  1482.       .endm
  1483.       
  1484.       .macro bgela
  1485.       .ifeq $NARG-1
  1486.        bcla\0 4,0,\1
  1487.       .else
  1488.        bcla\0 4,4*(\1)+0,\2
  1489.       .endif
  1490.       .endm
  1491.       
  1492.       .macro bgtla
  1493.       .ifeq $NARG-1
  1494.        bcla\0 12,1,\1
  1495.       .else
  1496.        bcla\0 12,4*(\1)+1,\2
  1497.       .endif
  1498.       .endm
  1499.       
  1500.       .macro bnlla
  1501.       .ifeq $NARG-1
  1502.        bcla\0 4,0,\1
  1503.       .else
  1504.        bcla\0 4,4*(\1)+0,\2
  1505.       .endif
  1506.       .endm
  1507.       
  1508.       .macro bnela
  1509.       .ifeq $NARG-1
  1510.        bcla\0 4,2,\1
  1511.       .else
  1512.        bcla\0 4,4*(\1)+2,\2
  1513.       .endif
  1514.       .endm
  1515.       
  1516.       .macro bngla
  1517.       .ifeq $NARG-1
  1518.        bcla\0 4,1,\1
  1519.       .else
  1520.        bcla\0 4,4*(\1)+1,\2
  1521.       .endif
  1522.       .endm
  1523.       
  1524.       .macro bsola
  1525.       .ifeq $NARG-1
  1526.        bcla\0 12,3,\1
  1527.       .else
  1528.        bcla\0 12,4*(\1)+3,\2
  1529.       .endif
  1530.       .endm
  1531.       
  1532.       .macro bnsla
  1533.       .ifeq $NARG-1
  1534.        bcla\0 4,3,\1
  1535.       .else
  1536.        bcla\0 4,4*(\1)+3,\2
  1537.       .endif
  1538.       .endm
  1539.       
  1540.       .macro bunla
  1541.       .ifeq $NARG-1
  1542.        bcla\0 12,3,\1
  1543.       .else
  1544.        bcla\0 12,4*(\1)+3,\2
  1545.       .endif
  1546.       .endm
  1547.       
  1548.       .macro bnula
  1549.       .ifeq $NARG-1
  1550.        bcla\0 4,3,\1
  1551.       .else
  1552.        bcla\0 4,4*(\1)+3,\2
  1553.       .endif
  1554.       .endm
  1555.       
  1556.       
  1557.       .macro bltlrl
  1558.       .ifeq $NARG-1
  1559.        bclrl\0 12,4*(\1)+0
  1560.       .else
  1561.        bclrl\0 12,0
  1562.       .endif
  1563.       .endm
  1564.       
  1565.       .macro blelrl
  1566.       .ifeq $NARG-1
  1567.        bclrl\0 4,4*(\1)+1
  1568.       .else
  1569.        bclrl\0 4,1
  1570.       .endif
  1571.       .endm
  1572.       
  1573.       .macro beqlrl
  1574.       .ifeq $NARG-1
  1575.        bclrl\0 12,4*(\1)+2
  1576.       .else
  1577.        bclrl\0 12,2
  1578.       .endif
  1579.       .endm
  1580.       
  1581.       .macro bgelrl
  1582.       .ifeq $NARG-1
  1583.        bclrl\0 4,4*(\1)+0
  1584.       .else
  1585.        bclrl\0 4,0
  1586.       .endif
  1587.       .endm
  1588.       
  1589.       .macro bgtlrl
  1590.       .ifeq $NARG-1
  1591.        bclrl\0 12,4*(\1)+1
  1592.       .else
  1593.        bclrl\0 12,1
  1594.       .endif
  1595.       .endm
  1596.       
  1597.       .macro bnllrl
  1598.       .ifeq $NARG-1
  1599.        bclrl\0 4,4*(\1)+0
  1600.       .else
  1601.        bclrl\0 4,0
  1602.       .endif
  1603.       .endm
  1604.       
  1605.       .macro bnelrl
  1606.       .ifeq $NARG-1
  1607.        bclrl\0 4,4*(\1)+2
  1608.       .else
  1609.        bclrl\0 4,2
  1610.       .endif
  1611.       .endm
  1612.       
  1613.       .macro bnglrl
  1614.       .ifeq $NARG-1
  1615.        bclrl\0 4,4*(\1)+1
  1616.       .else
  1617.        bclrl\0 4,1
  1618.       .endif
  1619.       .endm
  1620.       
  1621.       .macro bsolrl
  1622.       .ifeq $NARG-1
  1623.        bclrl\0 12,4*(\1)+3
  1624.       .else
  1625.        bclrl\0 12,3
  1626.       .endif
  1627.       .endm
  1628.       
  1629.       .macro bnslrl
  1630.       .ifeq $NARG-1
  1631.        bclrl\0 4,4*(\1)+3
  1632.       .else
  1633.        bclrl\0 4,3
  1634.       .endif
  1635.       .endm
  1636.       
  1637.       .macro bunlrl
  1638.       .ifeq $NARG-1
  1639.        bclrl\0 12,4*(\1)+3
  1640.       .else
  1641.        bclrl\0 12,3
  1642.       .endif
  1643.       .endm
  1644.       
  1645.       .macro bnulrl
  1646.       .ifeq $NARG-1
  1647.        bclrl\0 4,4*(\1)+3
  1648.       .else
  1649.        bclrl\0 4,3
  1650.       .endif
  1651.       .endm
  1652.       
  1653.       .macro bltctrl
  1654.       .ifeq $NARG-1
  1655.        bcctrl\0 12,4*(\1)+0
  1656.       .else
  1657.        bcctrl\0 12,0
  1658.       .endif
  1659.       .endm
  1660.       
  1661.       .macro blectrl
  1662.       .ifeq $NARG-1
  1663.        bcctrl\0 4,4*(\1)+1
  1664.       .else
  1665.        bcctrl\0 4,1
  1666.       .endif
  1667.       .endm
  1668.       
  1669.       .macro beqctrl
  1670.       .ifeq $NARG-1
  1671.        bcctrl\0 12,4*(\1)+2
  1672.       .else
  1673.        bcctrl\0 12,2
  1674.       .endif
  1675.       .endm
  1676.       
  1677.       .macro bgectrl
  1678.       .ifeq $NARG-1
  1679.        bcctrl\0 4,4*(\1)+0
  1680.       .else
  1681.        bcctrl\0 4,0
  1682.       .endif
  1683.       .endm
  1684.       
  1685.       .macro bgtctrl
  1686.       .ifeq $NARG-1
  1687.        bcctrl\0 12,4*(\1)+1
  1688.       .else
  1689.        bcctrl\0 12,1
  1690.       .endif
  1691.       .endm
  1692.       
  1693.       .macro bnlctrl
  1694.       .ifeq $NARG-1
  1695.        bcctrl\0 4,4*(\1)+0
  1696.       .else
  1697.        bcctrl\0 4,0
  1698.       .endif
  1699.       .endm
  1700.       
  1701.       .macro bnectrl
  1702.       .ifeq $NARG-1
  1703.        bcctrl\0 4,4*(\1)+2
  1704.       .else
  1705.        bcctrl\0 4,2
  1706.       .endif
  1707.       .endm
  1708.       
  1709.       .macro bngctrl
  1710.       .ifeq $NARG-1
  1711.        bcctrl\0 4,4*(\1)+1
  1712.       .else
  1713.        bcctrl\0 4,1
  1714.       .endif
  1715.       .endm
  1716.       
  1717.       .macro bsoctrl
  1718.       .ifeq $NARG-1
  1719.        bcctrl\0 12,4*(\1)+3
  1720.       .else
  1721.        bcctrl\0 12,3
  1722.       .endif
  1723.       .endm
  1724.       
  1725.       .macro bnsctrl
  1726.       .ifeq $NARG-1
  1727.        bcctrl\0 4,4*(\1)+3
  1728.       .else
  1729.        bcctrl\0 4,3
  1730.       .endif
  1731.       .endm
  1732.       
  1733.       .macro bunctrl
  1734.       .ifeq $NARG-1
  1735.        bcctrl\0 12,4*(\1)+3
  1736.       .else
  1737.        bcctrl\0 12,3
  1738.       .endif
  1739.       .endm
  1740.       
  1741.       .macro bnuctrl
  1742.       .ifeq $NARG-1
  1743.        bcctrl\0 4,4*(\1)+3
  1744.       .else
  1745.        bcctrl\0 4,3
  1746.       .endif
  1747.       .endm
  1748.       
  1749.       
  1750.       .macro crset
  1751.        creqv \1,\1,\1
  1752.       .endm
  1753.       
  1754.       .macro crclr
  1755.        crxor \1,\1,\1
  1756.       .endm
  1757.       
  1758.       .macro crmove
  1759.        cror \1,\2,\2
  1760.       .endm
  1761.       
  1762.       .macro crnot
  1763.        crnor \1,\2,\2
  1764.       .endm
  1765.       
  1766.       
  1767.       .macro trap
  1768.        tw 31,0,0
  1769.       .endm
  1770.       
  1771.       .macro twlt
  1772.        tw 16,\1,\2
  1773.       .endm
  1774.       
  1775.       .macro twle
  1776.        tw 20,\1,\2
  1777.       .endm
  1778.       
  1779.       .macro tweq
  1780.        tw 4,\1,\2
  1781.       .endm
  1782.       
  1783.       .macro twge
  1784.        tw 12,\1,\2
  1785.       .endm
  1786.       
  1787.       .macro twgt
  1788.        tw 8,\1,\2
  1789.       .endm
  1790.       
  1791.       .macro twnl
  1792.        tw 12,\1,\2
  1793.       .endm
  1794.       
  1795.       .macro twne
  1796.        tw 24,\1,\2
  1797.       .endm
  1798.       
  1799.       .macro twng
  1800.        tw 20,\1,\2
  1801.       .endm
  1802.       
  1803.       .macro twllt
  1804.        tw 2,\1,\2
  1805.       .endm
  1806.       
  1807.       .macro twlle
  1808.        tw 6,\1,\2
  1809.       .endm
  1810.       
  1811.       .macro twlge
  1812.        tw 5,\1,\2
  1813.       .endm
  1814.       
  1815.       .macro twlgt
  1816.        tw 1,\1,\2
  1817.       .endm
  1818.       
  1819.       .macro twlnl
  1820.        tw 5,\1,\2
  1821.       .endm
  1822.       
  1823.       .macro twlng
  1824.        tw 6,\1,\2
  1825.       .endm
  1826.       
  1827.       .macro twlti
  1828.        twi 16,\1,\2
  1829.       .endm
  1830.       
  1831.       .macro twlei
  1832.        twi 20,\1,\2
  1833.       .endm
  1834.       
  1835.       .macro tweqi
  1836.        twi 4,\1,\2
  1837.       .endm
  1838.       
  1839.       .macro twgei
  1840.        twi 12,\1,\2
  1841.       .endm
  1842.       
  1843.       .macro twgti
  1844.        twi 8,\1,\2
  1845.       .endm
  1846.       
  1847.       .macro twnli
  1848.        twi 12,\1,\2
  1849.       .endm
  1850.       
  1851.       .macro twnei
  1852.        twi 24,\1,\2
  1853.       .endm
  1854.       
  1855.       .macro twngi
  1856.        twi 20,\1,\2
  1857.       .endm
  1858.       
  1859.       .macro twllti
  1860.        twi 2,\1,\2
  1861.       .endm
  1862.       
  1863.       .macro twllei
  1864.        twi 6,\1,\2
  1865.       .endm
  1866.       
  1867.       .macro twlgei
  1868.        twi 5,\1,\2
  1869.       .endm
  1870.       
  1871.       .macro twlgti
  1872.        twi 1,\1,\2
  1873.       .endm
  1874.       
  1875.       .macro twlnli
  1876.        twi 5,\1,\2
  1877.       .endm
  1878.       
  1879.       .macro twlngi
  1880.        twi 6,\1,\2
  1881.       .endm
  1882.       
  1883.       .macro tdlt
  1884.        td 16,\1,\2
  1885.       .endm
  1886.       
  1887.       .macro tdle
  1888.        td 20,\1,\2
  1889.       .endm
  1890.       
  1891.       .macro tdeq
  1892.        td 4,\1,\2
  1893.       .endm
  1894.       
  1895.       .macro tdge
  1896.        td 12,\1,\2
  1897.       .endm
  1898.       
  1899.       .macro tdgt
  1900.        td 8,\1,\2
  1901.       .endm
  1902.       
  1903.       .macro tdnl
  1904.        td 12,\1,\2
  1905.       .endm
  1906.       
  1907.       .macro tdne
  1908.        td 24,\1,\2
  1909.       .endm
  1910.       
  1911.       .macro tdng
  1912.        td 20,\1,\2
  1913.       .endm
  1914.       
  1915.       .macro tdllt
  1916.        td 2,\1,\2
  1917.       .endm
  1918.       
  1919.       .macro tdlle
  1920.        td 6,\1,\2
  1921.       .endm
  1922.       
  1923.       .macro tdlge
  1924.        td 5,\1,\2
  1925.       .endm
  1926.       
  1927.       .macro tdlgt
  1928.        td 1,\1,\2
  1929.       .endm
  1930.       
  1931.       .macro tdlnl
  1932.        td 5,\1,\2
  1933.       .endm
  1934.       
  1935.       .macro tdlng
  1936.        td 6,\1,\2
  1937.       .endm
  1938.       
  1939.       .macro tdlti
  1940.        tdi 16,\1,\2
  1941.       .endm
  1942.       
  1943.       .macro tdlei
  1944.        tdi 20,\1,\2
  1945.       .endm
  1946.       
  1947.       .macro tdeqi
  1948.        tdi 4,\1,\2
  1949.       .endm
  1950.       
  1951.       .macro tdgei
  1952.        tdi 12,\1,\2
  1953.       .endm
  1954.       
  1955.       .macro tdgti
  1956.        tdi 8,\1,\2
  1957.       .endm
  1958.       
  1959.       .macro tdnli
  1960.        tdi 12,\1,\2
  1961.       .endm
  1962.       
  1963.       .macro tdnei
  1964.        tdi 24,\1,\2
  1965.       .endm
  1966.       
  1967.       .macro tdngi
  1968.        tdi 20,\1,\2
  1969.       .endm
  1970.       
  1971.       .macro tdllti
  1972.        tdi 2,\1,\2
  1973.       .endm
  1974.       
  1975.       .macro tdllei
  1976.        tdi 6,\1,\2
  1977.       .endm
  1978.       
  1979.       .macro tdlgei
  1980.        tdi 5,\1,\2
  1981.       .endm
  1982.       
  1983.       .macro tdlgti
  1984.        tdi 1,\1,\2
  1985.       .endm
  1986.       
  1987.       .macro tdlnli
  1988.        tdi 5,\1,\2
  1989.       .endm
  1990.       
  1991.       .macro tdlngi
  1992.        tdi 6,\1,\2
  1993.       .endm
  1994.       
  1995.       
  1996.       .macro mtxer
  1997.        mtspr 1,\1
  1998.       .endm
  1999.       
  2000.       .macro mtlr
  2001.        mtspr 8,\1
  2002.       .endm
  2003.       
  2004.       .macro mtctr
  2005.        mtspr 9,\1
  2006.       .endm
  2007.       
  2008.       .macro mtdsisr
  2009.        mtspr 18,\1
  2010.       .endm
  2011.       
  2012.       .macro mtdar
  2013.        mtspr 19,\1
  2014.       .endm
  2015.       
  2016.       .macro mtdec
  2017.        mtspr 22,\1
  2018.       .endm
  2019.       
  2020.       .macro mtsdr1
  2021.        mtspr 25,\1
  2022.       .endm
  2023.       
  2024.       .macro mtsrr0
  2025.        mtspr 26,\1
  2026.       .endm
  2027.       
  2028.       .macro mtsrr1
  2029.        mtspr 27,\1
  2030.       .endm
  2031.       
  2032.       .macro mtsprg
  2033.        mtspr 272+(\1),\2
  2034.       .endm
  2035.       
  2036.       .macro mtasr
  2037.        mtspr 280,\1
  2038.       .endm
  2039.       
  2040.       .macro mtear
  2041.        mtspr 282,\1
  2042.       .endm
  2043.       
  2044.       .macro mttbl
  2045.        mtspr 284,\1
  2046.       .endm
  2047.       
  2048.       .macro mttbu
  2049.        mtspr 285,\1
  2050.       .endm
  2051.       
  2052.       .macro mtibatu
  2053.        mtspr 528+2*(\1),\2
  2054.       .endm
  2055.       
  2056.       .macro mtibatl
  2057.        mtspr 529+2*(\1),\2
  2058.       .endm
  2059.       
  2060.       .macro mtdbatu
  2061.        mtspr 536+2*(\1),\2
  2062.       .endm
  2063.       
  2064.       .macro mtdbatl
  2065.        mtspr 537+2*(\1),\2
  2066.       .endm
  2067.       
  2068.       .macro mtdabr
  2069.        mtspr 1013,\1
  2070.       .endm
  2071.       
  2072.       .macro mfxer
  2073.        mfspr \1,1
  2074.       .endm
  2075.       
  2076.       .macro mflr
  2077.        mfspr \1,8
  2078.       .endm
  2079.       
  2080.       .macro mfctr
  2081.        mfspr \1,9
  2082.       .endm
  2083.       
  2084.       .macro mfdsisr
  2085.        mfspr \1,18
  2086.       .endm
  2087.       
  2088.       .macro mfdar
  2089.        mfspr \1,19
  2090.       .endm
  2091.       
  2092.       .macro mfdec
  2093.        mfspr 22,\1
  2094.       .endm
  2095.       
  2096.       .macro mfsdr1
  2097.        mfspr \1,25
  2098.       .endm
  2099.       
  2100.       .macro mfsrr0
  2101.        mfspr \1,26
  2102.       .endm
  2103.       
  2104.       .macro mfsrr1
  2105.        mfspr \1,27
  2106.       .endm
  2107.       
  2108.       .macro mfsprg
  2109.        mfspr \1,272+(\2)
  2110.       .endm
  2111.       
  2112.       .macro mfasr
  2113.        mfspr \1,280
  2114.       .endm
  2115.       
  2116.       .macro mfear
  2117.        mfspr \1,282
  2118.       .endm
  2119.       
  2120.       .macro mftbl
  2121.        mftb \1,268
  2122.       .endm
  2123.       
  2124.       .macro mftbu
  2125.        mftb \1,269
  2126.       .endm
  2127.       
  2128.       .macro mfpvr
  2129.        mfspr \1,287
  2130.       .endm
  2131.       
  2132.       .macro mfibatu
  2133.        mfspr \1,528+2*(\2)
  2134.       .endm
  2135.       
  2136.       .macro mfibatl
  2137.        mfspr \1,529+2*(\2)
  2138.       .endm
  2139.       
  2140.       .macro mfdbatu
  2141.        mfspr \1,536+2*(\2)
  2142.       .endm
  2143.       
  2144.       .macro mfdbatl
  2145.        mfspr \1,537+2*(\2)
  2146.       .endm
  2147.       
  2148.       .macro mfdabr
  2149.        mfspr \1,1013
  2150.       .endm
  2151.       
  2152.       
  2153.       .macro nop
  2154.        ori 0,0,0
  2155.       .endm
  2156.       
  2157.       .macro li
  2158.        addi \1,0,\2
  2159.       .endm
  2160.       
  2161.       .macro lis
  2162.        addis \1,0,\2
  2163.       .endm
  2164.       
  2165.       .macro mr
  2166.        or \1,\2,\2
  2167.       .endm
  2168.       
  2169.       .macro mr.
  2170.        or. \1,\2,\2
  2171.       .endm
  2172.       
  2173.       .macro not
  2174.        nor \1,\2,\2
  2175.       .endm
  2176.       
  2177.       .macro not.
  2178.        nor. \1,\2,\2
  2179.       .endm
  2180.       
  2181.       .macro mtcr
  2182.        mtcrf 0xff,\1
  2183.       .endm
  2184.  
  2185.  
  2186. BUGS
  2187.      Not all of the 64-bit extended mnemonics are supported.
  2188.  
  2189.  
  2190. Frank Wille                  21-Oct-1998                frank@phoenix.owl.de
  2191.